﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="adsales_Default" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
         table { border-collapse:collapse; border: none; padding: 0; margin: 0; }
    </style>
    <link href="../css/ecrm03.css" rel="stylesheet" type="text/css" />
    <link href="../css/pagebox.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery0905.js" type="text/javascript"></script>
    <script src="../js/jqModal.js" type="text/javascript"></script>  
    <script language="JScript" src="../js/myCheck.js"></script>
    <script type="text/javascript" language="javascript">  
    function chk() 
	{
		if(CheckText(form1.txt_id,"编码",30)==false) return false;
		if(CheckText(form1.txt_name,"姓名",10)==false) return false;
		if(CheckText(form1.txt_text,"备注",30)==false) return false;
		
		
		
		return true;
	}
	function chk1()
	{
	    if(CheckText(form1.txt_uname,"姓名",10)==false) return false;
		if(CheckText(form1.txt_upost,"职位",10)==false) return false;
		if(CheckText(form1.txt_utext,"备注",30)==false) return false;
	}
    $(function() {
        $("#checkedAll").click(function() { 
            if ($(this).attr("checked") == true) { // 全选
                    $("input[@type='checkbox']").each(function() {
                    $(this).attr("checked", true);
                    });
                } else { // 取消全选
                    $("input[@type='checkbox']").each(function() {
                    $(this).attr("checked", false);
                });
            }
        });
    });
    
    $().ready(function() {
        $('#divInsert').jqm({modal: true,trigger: '#btn_Insert'});
        $('#divUpdate').jqm({modal: true,trigger: '#btn_update'});
//        $('#divDelete').jqm({trigger: '#delete'});
//        $('#divUpload').jqm({trigger: '#upload'});
//        $('#divCopy').jqm({trigger: '#copy'});
//        $('#divPaste').jqm({trigger: '#paste'});
//        $('#divCut').jqm({trigger: '#cut'});
//        $('#divKeyword').jqm({trigger: '#addkeyword'}); 
//        $('#divRemark').jqm({trigger:'#remark'});
    });
    function checkfile()
    {
        var ext=$('#FileUpload1').val().split(".")[$('#FileUpload1').val().split(".").length-1];
        var notstr="bat,com,exe";
        if(notstr.indexOf(ext) !=-1)
        {
            alert("不能上传可执行文件!");
            return false;
        }
        return true;
    }
    function checksel()
    {
        var count=$("input[@type='checkbox']")
    }
        function showdiv()
    {
        $('#divUpdate').jqmShow(); 
    }
    
    function edit(strid)
    {
        var urlstring="Default.aspx";
            $.ajax({
            url:urlstring,
            type:'post',
            dataType:'html',
            data:'&opration=edit&id='+ strid ,
            beforeSend:function()
            {
               
            },
            error:function()
            {
               
            },
            success: function(msg)
            {
                var val=msg.split(',');
            
                $('#txt_uid').val(val[0]);
                $('#txt_uname').val(val[1]);
                $('#txt_usex').val(val[2]);
                $('#txt_upost').val(val[3]);
                $('#txt_utext').val(val[4]);
                $('#txt_ustate').val(val[5]);
                $('#txt_uinsertname').val(val[6]);   
                $('#txt_utime').val(val[5]);
                $('#lbl_id').text(val[0]);
                $('#HiddenField1').val(val[0]);
                $('#divUpdate').jqmShow(); 
            }
            });
    }
    function showdivinsert()
    {
         $('#divInsert').jqmShow();
    }
    
      function   kk(obj)   
      {           
      if(obj.value.length==10)   
      {   
      event.keyCode   =   0;   
      return   ;   
      }   
      } 
function ddlbind()
    {
        var urlstring="Default.aspx";
            $.ajax({
            url:urlstring,
            type:'post',
            dataType:'html',
            data:'&opration=ddlbind' ,
            beforeSend:function()
            {
               
            },
            error:function()
            {
               
            },
            success: function(msg)
            {
            }
            });
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
     <div id="menu">
    <%--<ul>
        <li><a href="Default.aspx"><img title="刷新" alt="刷新" src="../webdisk/images/ico/refresh.gif" /> 刷新</a>&nbsp;</li><li id='li1' runat="server" >        
    </li>
        
    </ul>--%>
    
   <div id="divInsert" class="jqmWindow" style="display:none; left: 68%; top: 18%; width: 271px; height: 234px;">
       <table width='100%' style ="background-color:#0075b0">
            <tr>
                 <td align="left" id='tdtitle' style="font-size:12px;color:White">增加</td>
                <td align="right" ><asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/adsales/images/close.png"
                    OnClick="ImageButton2_Click" /></td>
            </tr>
       </table>
       <br />
       <table>
            <tr>
                <td style="width: 128px; text-align: right">编码：</td>
                <td><asp:TextBox ID="txt_id" runat="server"></asp:TextBox></td>
                <td style="width: 90px">
                    </td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right">姓名：</td>
                <td style="text-align: left"><asp:TextBox ID="txt_name" runat="server" MaxLength="10"></asp:TextBox></td>
                <td style="width: 90px">
                    </td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right">性别：</td>
                <td style="text-align: left"><asp:DropDownList ID="ddl_sex" runat="server">
           <asp:ListItem>男</asp:ListItem>
           <asp:ListItem>女</asp:ListItem>
       </asp:DropDownList></td>
                <td style="width: 90px; text-align: left">
                </td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right; height: 24px;">职位：</td>
                <td style="text-align: left; height: 24px;">
                    <asp:DropDownList ID="ddl_post" runat="server" Width="98px">
                    </asp:DropDownList></td>
                <td style="width: 90px; height: 24px;">
                    </td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right">备注：</td>
                <td colspan="2" rowspan="2" style="text-align: left">
                    <asp:TextBox ID="txt_text" runat="server" Height="28px" MaxLength="10" Width="185px" Rows="2" TextMode="MultiLine" >没有什么可写的！</asp:TextBox>&nbsp;
                </td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right"></td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right">
                    状态：</td>
                <td style="text-align: left">
                    <asp:CheckBox ID="cbox_state" runat="server" Checked="True" Text="显示" /><%--<asp:RadioButton ID="rbtn_yes" runat="server" Checked="True" GroupName="2" Text="有效" />
                    <asp:RadioButton ID="rbtn_no" runat="server" GroupName="2" Text="失效" />--%></td>
                <td style="width: 90px">
                    </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Button ID="btn_insert" runat="server" Text="确定" OnClick="btn_insert_Click"  Width="50px" OnClientClick="return chk()" style="color: #ffffff; background-color: #296cb3" Height="20px"  /></td>
            </tr>
       </table>
       
       
       
       
   </div>
   
   <div id="divUpdate" class="jqmWindow" style="display:none;left:68%;top:18%; width: 273px; height: 242px;">
       
       
          <table width='100%' style ="background-color:#0075b0">
            <tr>
                 <td align="left" id='td1' style="font-size:12px;color:White">修改</td>
                <td align="right" ><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/adsales/images/close.png"
                    OnClick="ImageButton1_Click" /></td>
            </tr>
       </table>    
               
        <br />
        <table>
            <tr>
                <td style="width: 159px; text-align: right">编码：</td>
                <td style="text-align: left">
       <asp:Label ID="lbl_id" runat="server"></asp:Label></td>
                <td style="width: 90px; text-align: left">
                </td>
            </tr>
            <tr>
                <td style="width: 159px; text-align: right">姓名：</td>
                <td style="text-align: left"><asp:TextBox ID="txt_uname" runat="server" MaxLength="10" Width="133px"></asp:TextBox></td>
                <td style="width: 90px">
                    </td>
            </tr>
            <tr>
                <td style="width: 159px; text-align: right">性别：</td>
                <td style="text-align: left"><asp:DropDownList ID="ddl_usex" runat="server">
           <asp:ListItem>男</asp:ListItem>
           <asp:ListItem>女</asp:ListItem>
       </asp:DropDownList></td>
                <td style="width: 90px; text-align: left" >
                </td>
            </tr>
            <tr>
                <td style="width: 159px; text-align: right">职位：</td>
                <td style="text-align: left">
                    <asp:DropDownList ID="ddl_upost" runat="server" Width="98px">
                    </asp:DropDownList></td>
                <td style="width: 90px">
                    </td>
            </tr>
            <tr>
                <td style="width: 159px; text-align: right">备注：</td>
                <td colspan="2" rowspan="2" style="text-align: left">
                    <asp:TextBox ID="txt_utext" runat="server" Height="30px" MaxLength="5" Rows="2" TextMode="MultiLine" Width="185px"></asp:TextBox>&nbsp;
                </td>
            </tr>
            <tr>
                <td style="width: 159px; text-align: right"></td>
            </tr>
            <tr>
                <td style="width: 159px; text-align: right">
                    状态：</td>
                <td style="text-align: left">
                    <asp:CheckBox ID="cbox_ustate" runat="server" Checked="True" Text="显示" /><%--<asp:RadioButton ID="rbtn_uyes" runat="server" Checked="True" GroupName="1" Text="有效" />
                    <asp:RadioButton ID="rbtn_uno" runat="server" GroupName="1" Text="失效" />--%></td>
                <td style="width: 90px">
                    </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="修改" Width="50px" OnClientClick="return chk1()" style="color: #ffffff; background-color: #296cb3" Height="20px"  />&nbsp;<asp:HiddenField ID="HiddenField1" runat="server" />
                </td>
            </tr>
        </table>
   </div>
   
    </div>
        <br />
        
       <table cellSpacing="0" cellPadding="0" border="0" align="center">
		    <tr>
		        <td style="background-color:White;padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px;">
		            <table cellSpacing="0" cellPadding="0" width="600" align="center" border="0" style="background-color:White;">
		                <tr>
		                    <td style="BORDER-RIGHT: #90b0de 1px solid; BORDER-TOP: #90b0de 1px solid; BORDER-LEFT: #90b0de 1px solid; BORDER-BOTTOM: #90b0de 1px solid; height: 213px; text-align: center;">
		                    
		                  
        <table border="0" width=600 align="center">
            <tr>
                <td style="border-top-width: 1px; font-weight: bold; border-left-width: 1px; border-left-color: #90b0de;
                    color: #004499; border-top-color: #90b0de; border-bottom: #90b0de 1px solid;
                    background-color: #ecf5ff; border-right-width: 1px; border-right-color: #90b0de; height: 29px;">
                    aaa</td>
            </tr>
               </table>
          <br />
        <table width="570" border="0" align="center" >
            <tr>
                <td colspan="6" style="background-color: #ecf5ff">
                    用户查找</td>
            </tr>
            <tr>
                <td style="width: 82px; text-align: right; height: 25px;">
                    编号：</td>
                <td style="width: 93px; height: 25px;">
                    <asp:TextBox ID="txt_SelectId" runat="server" Width="90px"></asp:TextBox></td>
                <td style="width: 82px; text-align: right; height: 25px;">
                    姓名：</td>
                <td style="width: 100px; height: 25px;">
                    <asp:TextBox ID="txt_SelectName" runat="server" Width="90px"></asp:TextBox></td>
                <td style="width: 100px; height: 25px;">
                    <asp:Button ID="btn_look" runat="server" Text="查看" Width="50px" OnClick="btn_look_Click" style="color: #ffffff; background-color: #296cb3" Height="20px" /></td>
                <td style="width: 100px; height: 25px;">
                    <asp:Button ID="btn_full" runat="server" OnClick="btn_full_Click" Text="显示全部" Width="66px" style="color: #ffffff; background-color: #296cb3" Height="20px" /></td>
            </tr>
            <tr>
                <td style="width: 82px">
                </td>
                <td style="width: 93px">
                </td>
                <td style="width: 82px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
            </tr>
            <tr>
                <td style="width: 82px; height: 22px;">
                </td>
                <td style="width: 93px; height: 22px;">
                </td>
                <td style="width: 82px; height: 22px;">
                </td>
                <td style="width: 100px; height: 22px;">
                </td>
                <td style="width: 100px; height: 22px;">
                    </td>
                <td style="width: 100px; height: 22px;">
                    </td>
            </tr>
        </table>
        
    <asp:Repeater  ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand"  >
            <HeaderTemplate>
                <table style="font-size:13px" border="0" width="570" align="center">
                <tr>
                    <td align="center" colspan=9 style="background-color: #ecf5ff">用户信息表</td>
                </tr>
                <tr > 
                    <td colspan=9 align="left"><%--<a id="Insert"
                    href="javascript:void(0);"><span style="color: #0000ff; text-decoration: underline">
                        <img title="增加" alt="增加" src="../webdisk/images/ico/folder_new.gif" /></span></a>--%>
                        <input type="button" id='btn_Insert' value='增加' onclick="ddlbind();" style=' height="20"; width=50; border-right-style: none; background-color: #296cb3; color: #ffffff; border-left-style: none;'/>
                        <%--<asp:button Width='40' id="btnAdd" runat="server"  Text="刷新" CausesValidation="false" BackColor="#296CB3" BorderStyle="None" ForeColor="White" ></asp:button>--%>
                        
                        <br /></td>
                       
                </tr>
                <tr style="background-color:#ecf5ff">
                    <td>编号</td>
                    <td>姓名</td>
                    <td>性别</td>
                    <td>职位</td>
                   
                    <td>状态</td>
                    
                    <td>选择</td>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <a href='javascript:void(0);' onclick ='javascript:edit("<%#Eval("SalesCode") %>")'><%#Eval("SalesCode") %></a>
                    </td>
                    <td>
                        <%#Eval("SalesName")%>
                    </td>
                    <td>
                        <%#Eval("Sex") %>
                    </td>
                    <td>
                        <%#Eval("infoname")%>
                    </td>
                    
                    <td>
                        <%#(Eval("Status").ToString() == "0" )? "N" : "Y"%>
                    </td>
                    
                    <td>
                    <asp:linkbutton id="lbDelete" runat="server" CommandName="Del" CommandArgument='<%#Eval("SalesCode") %>'><img border="0" src="./images/del.gif" alt="删除" onClick="javascript:{return confirm('删除操作不可恢复，确认吗？');}"></asp:linkbutton>
                        <%--<asp:Button ID="Button1" runat="server" Text="删除" CommandName="Del" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        <%--<asp:Button ID="btn_update" runat="server" Text="修改" OnClientClick="$('#divUpdate').jqmShow();" CommandName="update" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        
                    </td>
                </tr>
            </ItemTemplate>
             <AlternatingItemTemplate>
                <tr bgcolor="#ecf5ff">
                    <td>
                        <a href='javascript:void(0);' onclick ='javascript:edit("<%#Eval("SalesCode") %>")'><%#Eval("SalesCode") %></a>
                    </td>
                    <td>
                        <%#Eval("SalesName")%>
                    </td>
                    <td>
                        <%#Eval("Sex") %>
                    </td>
                    <td>
                        <%#Eval("infoname")%>
                    </td>
                    
                    <td>
                        <%#(Eval("Status").ToString()=="0")?"N":"Y" %>
                    </td>
                    
                    <td>
                    <asp:linkbutton id="lbDelete" runat="server" CommandName="Del" CommandArgument='<%#Eval("SalesCode") %>'><img border="0" src="./images/del.gif" alt="删除" onClick="javascript:{return confirm('删除操作不可恢复，确认吗？');}"></asp:linkbutton>
                        <%--<asp:Button ID="Button1" runat="server" Text="删除" CommandName="Del" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        <%--<asp:Button ID="btn_update" runat="server" Text="修改" OnClientClick="$('#divUpdate').jqmShow();" CommandName="update" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        
                    </td>
                </tr>

             </AlternatingItemTemplate>
             

            <FooterTemplate>
                    <tr>
                        <td colspan=9 style="width=100%"><%=pager%></td>
                    </tr>
                </table>
            </FooterTemplate>
        </asp:Repeater>
            
     
        <br />       
       
		                    </td>
		                </tr>
		            </table>
		        </td>
		    </tr>
		</table>
        

        <br />
        <span style="font-size: 10pt"></span>
    </form>
</body>
</html>
